import { CoreModule, provideAbpCore, withOptions } from '@abp/ng.core';
import { registerLocale } from '@abp/ng.core/locale';
import { provideFeatureManagementConfig } from '@abp/ng.feature-management';
import { provideAbpOAuth } from '@abp/ng.oauth';
import { provideIdentityConfig } from '@abp/ng.identity/config';
import { provideSettingManagementConfig } from '@abp/ng.setting-management/config';
import { provideTenantManagementConfig } from '@abp/ng.tenant-management/config';
import { provideAccountConfig } from '@abp/ng.account/config';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA, APP_INITIALIZER } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { HttpClientModule } from '@angular/common/http';
import { ReactiveFormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { environment } from '../environments/environment';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BooksComponent } from './books/books.component';
import { KehusComponent } from './kehus/kehus.component';
import { VehicleComponent } from './Vehicle/vehicle.component';
import { OrdersComponent } from './orders/orders.component';
import { ADManagementComponent } from './admanagement/admanagement.component';
import { FleetcarComponent } from './fleetcar/fleetcar.component';
import { APP_ROUTE_PROVIDER } from './route.provider';
import { ThemeLeptonXModule } from '@abp/ng.theme.lepton-x';
import { SideMenuLayoutModule } from '@abp/ng.theme.lepton-x/layouts';
import { AccountLayoutModule } from '@abp/ng.theme.lepton-x/account';
import { ThemeSharedModule, withHttpErrorConfig, withValidationBluePrint, provideAbpThemeShared } from '@abp/ng.theme.shared';
import { SharedModule } from './shared/shared.module';
import { RedisMonitorComponent } from './redis-monitor/redis-monitor.component';
import { RedisCacheService } from './shared/services/redis-cache.service';


@NgModule({
    imports: [
    BrowserModule,
    BrowserAnimationsModule,
        HttpClientModule,
        ReactiveFormsModule,
        CommonModule,
    AppRoutingModule,
    CoreModule,
    ThemeLeptonXModule.forRoot(), SideMenuLayoutModule.forRoot(), AccountLayoutModule.forRoot(), ThemeSharedModule.forRoot(),
    SharedModule,
        ThemeLeptonXModule.forRoot(),
        SideMenuLayoutModule.forRoot(),
        AccountLayoutModule.forRoot(),
        ThemeSharedModule.forRoot(),
    BooksComponent,
    KehusComponent
],
    declarations: [AppComponent],
    schemas: [CUSTOM_ELEMENTS_SCHEMA],
    providers: [
    APP_ROUTE_PROVIDER,
    provideAbpCore(withOptions({
        environment,
        registerLocaleFn: registerLocale(),
    })),
    provideAbpOAuth(),
    provideSettingManagementConfig(),
    provideAccountConfig(),
    provideIdentityConfig(),
    provideTenantManagementConfig(),
    provideFeatureManagementConfig(),
    provideAbpThemeShared(withValidationBluePrint({
        wrongPassword: 'Please choose 1q2w3E*'
    })),
    RedisCacheService,
    {
        provide: APP_INITIALIZER,
        useFactory: () => () => registerLocale(),
        deps: [],
        multi: true,
    },
],
    bootstrap: [AppComponent],
})
export class AppModule {}
